home *** CD-ROM | disk | FTP | other *** search
/ Know Your Baseball - The Greatest Player Resource / Know Your Baseball - Greatest Player.iso / Baseball / Director / SHARED.CST / 00011_Script_Special KTG functions < prev    next >
Text File  |  1998-09-21  |  6KB  |  229 lines

  1. global sndflag, gClicked,gcontrols,gTXTflag,sndflag1,gbuttonStatus2,gbuttonStatus,gAll
  2.  
  3. on off
  4.   repeat with x = 40 to 48
  5.     set the blend of sprite x  = 0
  6.   end repeat
  7.   setspritesKTG
  8.   set sndflag1 = 3
  9.   go "1off"
  10.   mLoadKTGO(gcontrols)
  11.   mAllprompt(gcontrols) gAll
  12.   mOffndicators(gControls)
  13.   set gall = 0
  14.   set the castnum of sprite 25 to (the number of cast "showall")
  15.   setspritesKTG
  16. end
  17.  
  18.  
  19. on cen
  20.   repeat with x = 40 to 48
  21.     set the blend of sprite x  = 0
  22.   end repeat
  23.   setspritesKTG
  24.   set sndflag1 = 2
  25.   go "1cen"
  26.   mLoadKTGC(gcontrols)
  27.   mAllprompt(gcontrols) gAll
  28.   mCenIndicators(gControls)
  29.   set gAll = 0
  30.   set the castnum of sprite 25 to (the number of cast "showall")
  31.   setspritesKTG
  32. end
  33.  
  34.  
  35. on def
  36.   repeat with x = 40 to 48
  37.     set the blend of sprite x  = 0
  38.   end repeat
  39.   setspritesKTG
  40.   set sndflag1 = 1
  41.   go "1def"
  42.   mLoadKTGD(gcontrols)
  43.   mAllprompt(gcontrols) gAll
  44.   NewIndicators(gcontrols)
  45.   set gAll = 0
  46.   set the castnum of sprite 25 to (the number of cast "showall")
  47.   setspritesKTG
  48. end
  49.  
  50.  
  51.  
  52.  
  53. -- turns info text on and off  for offence, defence and centre
  54.  
  55. on ShowinfoD
  56.   set gAll = 1
  57.   showAll
  58.   set  a = the name of cast ( the castnum of sprite the clickon) & ".TXD"
  59.   repeat with x = 40 to 48
  60.     if the castnum of sprite x > 0 then set match = the name of cast (the castnum of sprite x)
  61.     if match = a  then
  62.       set the blend of sprite x  to  100
  63.     else
  64.       set the blend of sprite x to 0
  65.     end if
  66.   end repeat
  67. end
  68.  
  69. on ShowinfoC
  70.   set gAll = 1
  71.   showAll
  72.   set  a = the name of cast ( the castnum of sprite the clickon) & ".TXC"
  73.   repeat with x = 40 to 48
  74.     if the castnum of sprite x > 0 then set match = the name of cast (the castnum of sprite x)
  75.     if match = a  then
  76.       set the blend of sprite x  to  100
  77.     else
  78.       set the blend of sprite x to 0
  79.     end if
  80.   end repeat
  81. end
  82.  
  83. on ShowinfoO
  84.   set gAll = 1
  85.   showAll
  86.   set  a = the name of cast ( the castnum of sprite the clickon) & ".TXO"
  87.   repeat with x = 40 to 48
  88.     if the castnum of sprite x > 0 then set match = the name of cast (the castnum of sprite x)
  89.     if match = a  then
  90.       set the blend of sprite x  to  100
  91.     else
  92.       set the blend of sprite x to 0
  93.     end if
  94.   end repeat
  95. end
  96.  
  97.  
  98. on ShowAll
  99.   global gAll
  100.   if gAll  < 1 then
  101.     mAllprompt(gcontrols) gAll
  102.     set the castnum of sprite 25 to (the number of cast "Hideall")
  103.     repeat with x = 40 to 48
  104.       set the blend of sprite x = 100
  105.     end repeat
  106.     set gAll = 1
  107.     exit
  108.   end if
  109.   
  110.   if gAll = 1 then
  111.     mAllPrompt(gControls) gAll
  112.     set the castnum of sprite 25 to (the number of cast "showall")
  113.     repeat with x = 40 to 48
  114.       set the blend of sprite x = 0
  115.     end repeat
  116.     set gAll = 0
  117.   end if
  118. end
  119.  
  120. on ShowallFlys
  121.   global gAll
  122.   if gAll < 1 then
  123.     mAllPrompt(gControls) gAll
  124.     set the blend of sprite 48 = 100
  125.     set the castnum of sprite 27 to (the number of cast "Hideall")
  126.     set gAll = 1
  127.     updatestage
  128.     exit
  129.   end if
  130.   
  131.   if gAll = 1 then
  132.     mAllPrompt(gControls) gAll
  133.     set the blend of sprite 48 = 0
  134.     set the castnum of sprite 27 to (the number of cast "showall")
  135.     set gAll = 0
  136.     updatestage
  137.   end if
  138. end
  139. -- called from clipboard to turn off showall if it is on
  140.  
  141. on ShowallFlys1
  142.   global gAll
  143.   if gAll = 1 then
  144.     set the blend of sprite 48 = 0
  145.     set the castnum of sprite 27 to (the number of cast "showall")
  146.     set gAll = 0
  147.     updatestage
  148.   end if
  149. end
  150.  
  151. on HideallFly
  152.   if the blend of sprite 48 = 100 then
  153.     set the blend of sprite 48 to 0
  154.     set the castnum of sprite 27 to (the number of cast "showall")
  155.     FlyBallSound
  156.     updatestage
  157.   end if
  158.   FlyBallSound
  159.   AnimateIT
  160. end
  161. -- ball animation script
  162. on  AnimateIT
  163.   set the blend of sprite 34 to 100
  164.   set gH =  the loch of sprite gClicked - the locH of sprite 10
  165.   set gV = the locv of sprite gClicked -  the locV of sprite 10
  166.   set Pitch = gh/40
  167.   set the  locH of sprite 34 = the locH of sprite 10
  168.   set the locv of sprite 34 =  the locv of sprite 10
  169.   if gclicked = 19 then 
  170.     set gV = gv-24
  171.     set gH= gH+20
  172.     set the locv of sprite 34 =  the locv of sprite 10+10
  173.     
  174.   end if
  175.   
  176.   put the locH of sprite 34 into cx 
  177.   put the locv of sprite 34 into cv
  178.   if  pitch >=0 then
  179.     repeat with angle = 1 to 40
  180.       set offset = (20 - angle) /4
  181.       set the locH of sprite 34 to (gH/40)+the locH of sprite 34-offset
  182.       set the locV of sprite 34 to (gV/40)+the locV of sprite 34
  183.       updatestage
  184.     end repeat  
  185.   end if
  186.   if  pitch < 0 then
  187.     repeat with angle = 1 to 40
  188.       set offset = (20 - angle) /4
  189.       set the locH of sprite 34 to (gH/40)+the locH of sprite 34+offset
  190.       set the locV of sprite 34 to (gV/40)+the locV of sprite 34
  191.       updatestage
  192.     end repeat  
  193.   end if
  194.   set the blend of sprite 34 to 0
  195. end
  196.  
  197.  
  198.  
  199.  
  200. -- plays sound files for KTG3 flyballs
  201.  
  202. on FlyBallSound
  203.   mSoundPlayBack gControls,(gClicked-9),1,1
  204. end
  205.  
  206.  
  207.  
  208. on Clipboard
  209.   set the blend of sprite 48 to 0
  210.   set  a = the name of cast ( the castnum of sprite the clickon) & ".TXT"
  211.   repeat with x = 10 to 17
  212.     if the castnum of sprite x > 0 then set match = the name of cast (the castnum of sprite x)
  213.     if match = a  then
  214.       ShowallFlys1
  215.       set gClicked = x+9
  216.       animateIt
  217.       set gbuttonStatus2 = x+9
  218.       set the blend of sprite x  to  100
  219.       mSoundPlayBack gControls,( X),1,1
  220.     else
  221.       -- set the blend of sprite x to 0
  222.     end if
  223.   end repeat
  224.   
  225.   
  226. end
  227.  
  228.  
  229.